#ifndef AISERVERMANAGER_H
#define AISERVERMANAGER_H

#include <QObject>
#include <QWidget>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>

class AiServerManager : public QWidget
{
    Q_OBJECT
public:
    explicit AiServerManager(QWidget *parent = nullptr);
    void sendMassge(QString message); // 用于发送信息给AI

signals:
    void resposeReceive(const QString &response); // AI回复信息
    void errorOccured(const QString &error); // 错误信息
private slots:
    void onReplyFinished(QNetworkReply * reply);
private:
    QNetworkAccessManager * networkManager;
    QString apiKey; // API密钥
    QString apiUrl; // API 端点
};

#endif // AISERVERMANAGER_H
